﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Runda.EShop.Common.Entity;
using Runda.EShop.Bll;

namespace Runda.EShop.Web.UserControl
{
    public partial class TopMenu : UserControlBase
    {
        protected void Page_Load(object sender, EventArgs e)
        { 
            if (!IsPostBack)
            {
                SystemBll bll = new SystemBll();
                List<SysPageInfoEntity> function = bll.LoadAllPageInfo();
                List<SysPageInfoEntity> list = null;

                list = function.FindAll(f => string.IsNullOrEmpty(f.ParentPageID) && f.IsMenu == 1);

                rptMenu.DataSource = list;
                rptMenu.DataBind();
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += new EventHandler(Page_Load);
        }
    }
}